/*
 * main.h
 *
 *  Created on: 25.01.2010
 *      Author: Admin
 */

#ifndef MAIN_H
#define MAIN_H

#include <stdio.h>
#include <string.h>
#include <string>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <dlfcn.h>
#include "inkview.h"
#include "Viewer.h"
#include "ImagesMng.h"
#include "Log.h"


typedef struct settings_s {
	int magic;
	int page;
	int layout_mode;
	int do_fine_update;
} Settings;

#define PBIVCFGFILE CONFIGPATH "/pbimageviewer.cfg"


Viewer v;
ImagesMng mng;
char dirbuff[1024];


std::string infile;
bool have_archive = false;
int lastmenuindex = 0;
enum layout_modes { LAYOUT_DEFAULT, LAYOUT_FIT_PAGE, LAYOUT_FIT_HEIGHT, LAYOUT_FIT_WIDTH, LAYOUT_FULL_SIZE };
char *layout_variants[] = { GetLangText("@Fit_default"), GetLangText("@Fit_page"), GetLangText("@Fit_height"), GetLangText("@Fit_width"), GetLangText("@Full_size"), NULL };
char *fine_update_variants[] = { GetLangText("@Off"), GetLangText("@On"), NULL };
int layout_mode = LAYOUT_DEFAULT;
int step_divisor = 1;
bool do_fine_update = false;
char *lang = NULL;
iconfig *pbivcfg = NULL;
tocentry *toc = NULL;
ibitmap *pagemap = NULL;


void draw();

/*
void draw_pagemap();
*/

int main_handler(int type, int par1, int par2);
void dir_selected(char *path);

/*
void menu_handler(int index);
void pageselect_handler(int pagenum);
void contents_handler(long long pos);
char* unpack_to_dir();
void apply_settings();
void save_settings();
void conf_handler();
void read_config();
void save_config();
void create_toc();
void get_new_translations();
void show_help();
*/

#endif /* MAIN_H_ */
